<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
	<title>十年珠峰、专注前端</title>
	<!-- IMPORT CSS -->
	<link rel="stylesheet" href="dialogplugin.css">
</head>

<body>
	<button id="submit">点我测试</button>
	<button id="submit2">点我测试</button>

	<div id="dialog">
		<p>报名“前端Web高级开发课程”，让自己赚取高薪!</p>
		<a href="">哈哈</a>
	</div>

	<!-- IMPORT JS -->
	<script src="dialogplugin.js"></script>
	<script>
		let dlog1 = dialogplugin({
			// template: '报名“前端Web高级开发课程”，让自己赚取高薪!',
			template: document.querySelector('#dialog'),
			title: '系统温馨提示',
			buttons: [{
				text: '确定',
				click() {
					this.close();
				}
			}, {
				text: '取消',
				click() {
					this.close();
				}
			}],
			oninit() {
				console.log(1);
			},
			onopen() {
				console.log(2);
			},
			onclose() {
				console.log(3);
			}
		});

		submit.onclick = function () {
			messageplugin("报名“前端Web高级开发课程”，让自己赚取高薪!");
			/* messageplugin({
				message: '报名“前端Web高级开发课程”，让自己赚取高薪!',
				duration: 1000,
				type: 'success',
				onclose() {
					console.log('我关闭拉');
				}
			}); */
		};

		submit2.onclick = function () {
			dlog1.open();
		};
	</script>
</body>

</html>